<%@page import="com.sinba.common.system.dto.RuleDTO"%>
<%@page import="java.util.Map"%>
<%@page import="com.sinba.common.system.service.IRuleService"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
IRuleService ruleService = (IRuleService)ac.getBean("ruleService");
//Map<String,Double> maps = ruleService.findRuleMap(new String[]{"CloseWeb"});
RuleDTO ruleDTO = ruleService.findRuleInfo();
request.setAttribute("ruleDTO",ruleDTO);

request.setAttribute("curl",request.getRequestURL());


%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<c:if test="${language!=''}">
	<fmt:setLocale value="${language}"/>
	<fmt:setBundle basename="i18n.itilbase"/>
	<c:set var="lang" value="${language}"/>
</c:if>

<c:if test="${language=='' || language==null}">
	<fmt:setLocale value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
	<fmt:setBundle basename="i18n.itilbase"/>
	<c:set var="lang" value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
</c:if>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>顶</title>
<link rel="stylesheet" type="text/css" href="../styles/user/style.css" />
<script type="text/javascript" src="../scripts/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(function(){
	if('${ruleDTO.rule021}'=='true')
		window.top.location.href='707.jsp';
})
function logout(){
	if(confirm("Are you sure you want to quit it(确定退出吗)?")){
		window.top.location.href='logout.jsp';
	}
}
function setCookie(c_name,value,exdays){
	
	var exdate=new Date();
	exdate.setDate(exdate.getDate() + exdays);
	var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
	document.cookie=c_name + "=" + c_value;
}
function setLanguage(lang){
	setCookie('language',lang,300);
	window.top.location.reload();
}


</script>
</head>
<body>
		<div id="top">
            <div id="logo"></div>
            <div id="mainNav">
                <ul>
               		<li><a href="index.jsp" target="_top" onclick="changeCss()" class="mnCur" ><fmt:message key="i18n.indexPage"/></a></li>
               		<c:if test="${fn:contains(curl,'top.jsp')==true}">
               			<li><a href="news!newsInfo.action?newsQueryDTO.newType=CompanyProfile" target="main"  <c:if test="${session.location eq '003'}">class="mnCur"</c:if>> <fmt:message key="i18n.companyIntroduction"/></a></li>
               		</c:if>
               		<c:if test="${fn:contains(curl,'top.jsp')==false}">
                    <li><a href="news!newsInfoOut.action?newsQueryDTO.newType=CompanyProfile" > <fmt:message key="i18n.companyIntroduction"/></a></li>
                    </c:if>
                    
                    <c:if test="${fn:contains(curl,'top.jsp')==true}">
               			<li><a href="news!newsInfo.action?newsQueryDTO.newType=ContactUS" target="main"> <fmt:message key="i18n.ContactOur"/></a></li>
               		</c:if>
               		<c:if test="${fn:contains(curl,'top.jsp')==false}">
                    <li><a href="news!newsInfoOut.action?newsQueryDTO.newType=ContactUS" > <fmt:message key="i18n.ContactOur"/></a></li>
                    </c:if>
                    
                    
                    <c:if test="${empty loginName}">
                   		<li><a href="login.jsp" ><fmt:message key="i18n.login"/></a></li>
                    </c:if>
                    <c:if test="${not empty loginName}">
                    	<li><a href="index_main.html" target="_top"><fmt:message key="i18n.userCenter"/></a></li>
                    </c:if>
                    <c:if test="${fn:contains(curl,'top.jsp')==true}">
               			<li><a href="newsList.jsp?newType=WebNews" target="main"  ><fmt:message key="i18n.news"/></a></li>
               		</c:if>
               		<c:if test="${fn:contains(curl,'top.jsp')==false}">
                    <li><a href="newsList-out.jsp?newType=WebNews"><fmt:message key="i18n.news"/></a></li>
                    </c:if>
                </ul>
            </div>
            <!-- 未登录 -->
            <c:if test="${empty loginName}">
            <div class="tguiBar">
                   	<c:if test="${empty cookie['language'].value or cookie['language'].value eq 'en_US'}">
                       <a href="javascript:setLanguage('zh_CN');" class=""><span>
                    		简体中文
                        </span><b></b></a> 
                    </c:if>
                    
                    <c:if test="${cookie['language'].value eq 'zh_CN'}">
                       <a href="javascript:setLanguage('en_US');" class=""><span>
                    		English
                        </span><b></b></a> 
                    </c:if>
                    <a href="login.jsp" class="tLoginBtn">登录</a>
                    <a href="reg1.jsp" class="tRegBtn" target="_brank">注册</a>
            </div>
            </c:if>
            
            <!-- 已登录 -->
            <c:if test="${not empty loginName}">
            <div id="topBar">
            	<ul>
            		
            		<c:if test="${empty cookie['language'].value or cookie['language'].value eq 'en_US'}">
            			<li>
                        <a href="javascript:setLanguage('zh_CN');" class=""><span>
                    		简体中文
                        </span><b></b></a> 
                        </li>
                    </c:if>
                    
                    <c:if test="${cookie['language'].value eq 'zh_CN'}">
						<li>
                      	<a href="javascript:setLanguage('en_US');" class=""><span>
                    		English
                        </span><b></b></a> 
                        </li>
                    </c:if>
                    
            		<li><a href="index_main.html" class="tIcon_user" title="${loginName}">${userName}</a></li>
                    <li><a href="javascript:logout()" class="tIcon_exit"><fmt:message key="i18n.loginout"/></a></li>
                    <!-- <li><a href="#" class="tIcon_msg">消息( 2 )</a></li> -->
            		<%-- <li><a href="index_main.html" target="main" class="tb_site"><fmt:message key="i18n.setting"/></a></li> --%>
            	</ul>
            </div>
            </c:if>
            
	           <%--  <div id="topBar">
	                <div class="tb_l">
	                    <ul>
	                    	
	                        <c:if test="${not empty loginName}">
	                        
	                    	</c:if>
	                    </ul>
	                </div>
	                <c:if test="${not empty loginName}">
	                <div class="tb_r">
	                    <span><img src="images/user${session.registerLevel}.jpg" alt="${loginName}" style="width: 30px;height: 30px;" /></span>
	                    <strong>${userName}</strong>
	                </div>
	                </c:if>
	            </div> --%>
            
        </div>
        
</body>
</html>